<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cert_downs', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('project_id')->default(0);
            $table->unsignedBigInteger('cert_id')->default(0);
            $table->unsignedBigInteger('user_id')->default(0);
            $table->string('title', 255)->comment('项目名称');
            $table->string('purpose', 255)->nullable()->comment('用途');
            $table->date('end_date')->nullable()->comment('有效期');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cert_downs');
    }
};
